using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;

namespace Sybase.IDAL
{
   [Serializable]
   public class DALException : ApplicationException
   {
      /// <summary>
		/// Initializes a new instance of the <see cref="DALException"/> class.
		/// </summary>
	   public DALException() : base( "An exception occurred in the DAL layer." )
	   {
	   }

	   /// <summary>
	   /// Initializes a new instance of the <see cref="DALException"/> class.
		/// </summary>
		/// <param name="message">The message that describes the error. </param>
		public DALException( string message ) : base( message )
		{
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="DALException"/> class.
		/// </summary>
		/// <param name="innerException">
		/// The exception that is the cause of the current exception. If the innerException parameter 
		/// is not a null reference, the current exception is raised in a catch block that handles 
		/// the inner exception.
		/// </param>
		public DALException( Exception innerException ) : base( innerException.Message, innerException )
		{
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="DALException"/> class.
		/// </summary>
		/// <param name="message">The message that describes the error. </param>
		/// <param name="innerException">
		/// The exception that is the cause of the current exception. If the innerException parameter 
		/// is not a null reference, the current exception is raised in a catch block that handles 
		/// the inner exception.
		/// </param>
		public DALException( string message, Exception innerException ) : base( message, innerException )
		{
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="DALException"/> class 
		/// with serialized data.
		/// </summary>
		/// <param name="info">
		/// The <see cref="SerializationInfo"/> that holds the serialized object 
		/// data about the exception being thrown.
		/// </param>
		/// <param name="context">
		/// The <see cref="StreamingContext"/> that contains contextual information about the source or destination.
		/// </param>
		protected DALException( SerializationInfo info, StreamingContext context ) : base( info, context )
		{
		}
   }
}